return xce->ops->u.evtchn.bind_interdomain(xce, xce->ops_handle, domid, remote_port);
}
+evtchn_port_or_error_t
+xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+{
+ return xce->ops->u.evtchn.bind_virq(xce, xce->ops_handle, virq);
+}
+
/*
* Local variables:
* mode: C
return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+static evtchn_port_or_error_t
+linux_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_virq bind;
bind.virq = virq;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
}
int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
.notify = &linux_evtchn_notify,
.bind_unbound_port = &linux_evtchn_bind_unbound_port,
.bind_interdomain = &linux_evtchn_bind_interdomain,
+ .bind_virq = &linux_evtchn_bind_virq,
},
};
return 0;
}
-evtchn_port_or_error_t xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+static evtchn_port_or_error_t minios_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
{
+ int fd = (int)h;
evtchn_port_t port;
int i;
assert(get_current() == main_thread);
- i = port_alloc(xce->fd);
+ i = port_alloc(fd);
if (i == -1)
return -1;
printf("xc_evtchn_bind_virq(%d)", virq);
- port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)xce->fd);
+ port = bind_virq(virq, evtchn_handler, (void*)(intptr_t)fd);
if (port < 0) {
errno = -port;
return -1;
}
- files[xce->fd].evtchn.ports[i].bound = 1;
- files[xce->fd].evtchn.ports[i].port = port;
+ files[fd].evtchn.ports[i].bound = 1;
+ files[fd].evtchn.ports[i].port = port;
unmask_evtchn(port);
return port;
}
.notify = &minios_evtchn_notify,
.bind_unbound_port = &minios_evtchn_bind_unbound_port,
.bind_interdomain = &minios_evtchn_bind_interdomain,
+ .bind_virq = &minios_evtchn_bind_virq,
},
};
return ioctl(xce->fd, IOCTL_EVTCHN_UNBIND, &unbind);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+static evtchn_port_or_error_t
+netbsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_virq bind;
int err;
bind.virq = virq;
- err = ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+ err = ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
if (err)
return -1;
else
.notify = &netbsd_evtchn_notify,
.bind_unbound_port = &netbsd_evtchn_bind_unbound_port,
.bind_interdomain = &netbsd_evtchn_bind_interdomain,
+ .bind_virq = &netbsd_evtchn_bind_virq,
},
};
return ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
}
-evtchn_port_or_error_t
-xc_evtchn_bind_virq(xc_evtchn *xce, unsigned int virq)
+static evtchn_port_or_error_t
+solaris_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
{
+ int fd = (int)h;
struct ioctl_evtchn_bind_virq bind;
bind.virq = virq;
- return ioctl(xce->fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+ return ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
}
int xc_evtchn_unbind(xc_evtchn *xce, evtchn_port_t port)
.notify = &solaris_evtchn_notify,
.bind_unbound_port = &solaris_evtchn_bind_unbound_port,
.bind_interdomain = &solaris_evtchn_bind_interdomain,
+ .bind_virq = &solaris_evtchn_bind_virq,
},
};
evtchn_port_or_error_t (*bind_unbound_port)(xc_evtchn *xce, xc_osdep_handle h, int domid);
evtchn_port_or_error_t (*bind_interdomain)(xc_evtchn *xce, xc_osdep_handle h, int domid,
evtchn_port_t remote_port);
+ evtchn_port_or_error_t (*bind_virq)(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq);
} evtchn;
} u;
};